<?php

/**
 * Description of ControllerACL
 *
 * @author david
 */
class ControllerACL {

    private $config;

    public function __construct($config) {
        $this->config = $config;
    }

    public function permissaoBotao($nomeBotao) {
        $permissao = $this->config["acl-btn"];

        if (isset($permissao[$nomeBotao])) {

            if (isset($_SESSION["sis_tipo"])) {
                if (in_array($_SESSION["sis_tipo"], $permissao[$nomeBotao])) {
                    return true;
                } else {
                    return false;
                }
            } else {
                return false;
            }
        } else {
            return false;
        }
    }

}
